﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>采收入库</title>
    <style type="text/css">
        .auto-style1 {
            width: 40px;
        }
    </style>
</head>
<body>
    <div class="pd-5">
        <div class="text-c" id="findfdiv">
            
            <div class="formControls col-2">
                <span class="l">
                    <a href="javascript:;" onclick="showlist()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe687;</i> 管理入库明细</a>
                </span>
            </div>
        
            <input type="text" class="input-text" style="width: 150px" placeholder="地块" id="findmaindcinfo" name="findmaindcinfo">
            <input type="text" class="input-text" style="width: 150px" placeholder="品种" id="findtasksctypename" name="findtasksctypename">
            <button onclick="findreolad()" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 查询</button>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-5">
            <span class="l">
                <!--             <a href="javascript:;" onclick="toolDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
                <a href="javascript:;" onclick="toolUpdate()" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe6df;</i> 修改</a>
                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a>-->

            </span>
            <span class="r">操作提示：<strong>^_^</strong> </span>

        </div>
        <div class="mt-5 ml-20">
            <table class="table table-border table-bordered table-striped table-hover" id="tablelist" width="100%">
                <thead>
                    <tr class="text-c">
                        <th width="30"><a id="hcmtable_sall" onclick="hcmtable_sall();" href="javascript:;" title="全选反选"><i class="Hui-iconfont">&#xe608;全</i></a></th>
                        <th>类型</th>
                        <th>编号</th>
                        <th>品种</th>
                        <th>地块</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>

        </div>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../lib/datatables/1.10.0/jtable.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>
    <script type="text/javascript">
        var selectworktypeinfo = [];//所有作业类型
        $(function () {
           
            spsetBaseNoBt("hsc_task", "id", "hsc_task as T", "*", "#tablelist", "taskmplanlist", "种植计划", "taskmplanlist");
            hcui_ajaxasync = false;
            hcdoselbyPost("id,fv1 as name,fv3,fv4", "yw_baseinfo", "type='4' and  maintype='4' and fv3='11'", "", "", "id",function (data) {
                selectworktypeinfo = data;
            }); hcui_ajaxasync = true;
            //加载区域
            hcdoselbyPost("id,fv1 as name", "yw_baseinfo", "type='5' and  maintype='5' and databranchid=" + HCUser.HCUorg, "", "", "id",
                   function (data) {
                       SetSelectWithArrayIdName("#findfv5", data);
                   });
            hcmtable = $("#tablelist").DataTable({
                "serverSide": true,//服务端处理分页 无法使用当前查找
                "bFilter": false,  //是否使用内置的过滤功能
                "bInfo": true, "fnDrawCallback": function () { dTappendSkipPage(); },
                "bLengthChange": false, //改变每页显示数据数量
                "ajax": {
                    "type": "POST",
                    "url": spselUrl("  and databranchid=" + HCUser.HCUorg + " and taskstatus in('计划','种植')") + "&sporderby= dataaddtime  ",
                    "data": function (d) {
                        $("#findfdiv").find("input[type='text']").each(function () {
                            d[this.id] = $(this).val();
                        });
                        $("#findfdiv").find("select").each(function () {
                            d[this.id] = $(this).val();
                        });
                    }
                },
                "order": [[2, "asc"]],//默认第几个排序
                aLengthMenu: [10, 20, 50],
                "columns": [
                    { "data": "rowhcindex" }, { "data": "type" }, { "data": "taskno" }, { "data": "tasksctypename" },
                    { "data": "maindcinfo" }, { "data": "id" }
                ],

                "columnDefs": [
                   // 操作列
                    {
                        "targets": [5],
                        "render": function (data, type, row) {
                            return "<a style=\"text-decoration:none\" class=\"ml-5\" onClick=\"addTaskListInfo('" + selectworktypeinfo[0].id + "','" + row.taskmj + "','" + row.maindcid + "','" + row.id + "','" + selectworktypeinfo[0].fv3 + "','" + selectworktypeinfo[0].name + "')\" href=\"javascript:;\" title=\"" + selectworktypeinfo[0].name + "\"><i class=\"Hui-iconfont\">" + getimgcode(selectworktypeinfo[0].fv3) + selectworktypeinfo[0].name + "</i></a> ";
                            //"<a style=\"text-decoration:none\" onClick=\"toolUpdateById(" + data + ")\" href=\"javascript:;\" title=\"审核\">审核</a>" +
                        }
                    },
                    //不排序
                   {
                       "orderable": false,
                       "targets": [0]
                   }

                ]
            });
        });
        function getimgcode(workid) {
            if (workid == "2") { return "&#xe603;"; }
            else if (workid == "3") { return "&#xe64d;"; }
            else if (workid == "4") { return "&#xe6d1;"; }
            else if (workid == "5") { return "&#xe6c9;"; }
            else if (workid == "6") { return "&#xe6d3;"; }
            else if (workid == "7") { return "&#xe6b2;"; }
            else if (workid == "8") { return "&#xe6ac;"; }
            else if (workid == "9") { return "&#xe6bb;"; }
            else if (workid == "10") { return "&#xe606;"; }
            else if (workid == "11") { return "&#xe672;"; }
            else if (workid == "12") { return "&#xe688;"; }
            else if (workid == "13") { return "&#xe64d;"; }
            else if (workid == "14") { return "&#xe64d;"; }
            else if (workid == "15") { return "&#xe64d;"; }
            return "&#xe64d;";

        }
        function addTaskListInfo(worktype, workmj, dcid, taskid, worknum, workname) {
            if (worknum == 2 || worknum == 3 || worknum == 5 || worknum == 10) {
                opensimplediv("生产农事登记---" + workname, "sctasklist-worknewsimple-ae.html?action=add&urltaskid=" + taskid + "&urldcid=" + dcid +
                      "&urlworktype=" + worktype + "&urlworkmj=" + workmj + "&urlworknum=" + worknum);
            }
            else if (worknum == 4 || worknum == 7) {//底肥 水肥
                toolAdd("生产农事登记---" + workname, "sctasklist-worknewdf-ae.html?action=add&urltaskid=" + taskid + "&urldcid=" + dcid +
                      "&urlworktype=" + worktype + "&urlworkmj=" + workmj + "&urlworknum=" + worknum);
            }
            else if (worknum == 8) {//值保
                toolAdd("生产农事登记---" + workname, "sctasklist-worknewzb-ae.html?action=add&urltaskid=" + taskid + "&urldcid=" + dcid +
                      "&urlworktype=" + worktype + "&urlworkmj=" + workmj + "&urlworknum=" + worknum);
            }
            else if (worknum == 11)//采收
            {
                toolAdd("生产农事登记---" + workname, "sctasklist-worknewget-ae.html?action=add&urltaskid=" + taskid + "&urldcid=" + dcid +
                       "&urlworktype=" + worktype + "&urlworkmj=" + workmj + "&urlworknum=" + worknum);
            }
            else {
                toolAdd("生产农事登记", "sctasklist-worknew-ae.html?action=add&urltaskid=" + taskid + "&urldcid=" + dcid +
                      "&urlworktype=" + worktype + "&urlworkmj=" + workmj);
            }
        }
        function showlist() {
            var index = layer.open({
                type: 2,
                title: "采摘入库明细",
                content: "sctaskoutstore_inLogList.html"
            });
            layer.full(index);
        }
    </script>
</body>
</html>
